import { BaseController, CoolController } from "@cool-midway/core";
import { Get, Inject, Query } from "@midwayjs/core";
import { MediaInfoService } from "../../service/info";
import { MediaInfoEntity } from "../../entity/info";
import { ListByProviderIdDTO } from "../../dto/info";

@CoolController({
    api: ['list', 'page', 'delete'],
    entity: MediaInfoEntity,
    service: MediaInfoService,
})
export class AppMediaController extends BaseController {
    @Inject()
    mediaInfoService: MediaInfoService;

    @Get('/listByProviderId', { summary: '按服务人员ID获取媒体资源列表' })
    async listByProviderId(@Query() query: ListByProviderIdDTO) {
        return this.ok(await this.mediaInfoService.listByProviderId({ type: query.type }, query.providerId));
    }

    @Get('/teamListByProviderId', { summary: '按服务人员ID获取团队媒体资源列表' })
    async teamListByProviderId(@Query() query: ListByProviderIdDTO) {
        return this.ok(await this.mediaInfoService.teamListByProviderId({ type: query.type }, query.providerId));
    }
}


